package com.eb.controller;

import com.eb.Client.UserInterface;
import com.eb.pojo.MiaoshaUser;
import com.eb.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/shopuser")
@CrossOrigin
public class UserController {
    @Autowired
    private UserInterface userInterface;

    @GetMapping
    public List<MiaoshaUser> list(){
        return userInterface.list();
    }
    @PostMapping("/login")
    public Result login(@RequestBody MiaoshaUser miaoshaUser){
      return   userInterface.login(miaoshaUser);

    }
    @PostMapping("/zc")
    public Result zc(@RequestBody MiaoshaUser user){
       return userInterface.zc(user);
    }

    @GetMapping("/user")
    public MiaoshaUser user(){
        return  userInterface.user();
    }
}
